<template>
  <div>
   <h1>TestT</h1>
   <h1>名称：{{name}}</h1>
    <p>价格：{{price}}</p>
    <p>数量：{{num}}</p>
    <!-- <p>总价：{{price*num}}</p> -->
    <p>总价：{{count}}</p>
    <button @click="add">add</button>
    <button @click="getTestData">test</button>
   <router-view />
  </div>
</template>

<script>
import {mapState,mapMutations,mapGetters,mapActions} from 'vuex';

export default {
    mounted(){

    },
    computed:{
        ...mapState(["name","num","price"]),
        ...mapGetters(["count"])
    },
    methods:{
        ...mapMutations(["add"]),
        ...mapActions(["getTestData"])
    },

};
</script>